﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Citi.HeadCount.Domain.Repository
{
    public class RuleResultRepository : RepositoryBase<RuleResult>
    {
        public IEnumerable<RuleResult> GetActiveRules()
        {
            return GetAll().Where(x => x.Active);
        }

        public IEnumerable<RuleResult> GetActiveRulesButException()
        {
            return GetAll().Where(x => x.Active && !x.Exception);
        }
    
        public void SetAsException(int id)
        {
            var ruleResult = GetById(id);
            ruleResult.Exception = true;
            Save(ruleResult);
        }
    }
}
